package com.util;

/**
 * 
 * @author Satya Deepthi Bhagi
 */

public class RuntimeSettings {
	public static final String APPLICATION_NAME = "StudentProfile";
	public static final String VERSION_ID = " version 0.1 dated February 02, 2013";
	public static final String SERVER_IP = "localhost";
	static String databaseName = "studentprofile";
	static String dbUserID = "root";
	static String dbPassword = ""; 
	public static String RUN_MODE = "Test"; // "Production"; //
	public static boolean IS_IN_DEBUG_MODE = true; // false; //
	static int portNo = 3306;
	public static String scriptSql[] = {
			// " drop database if exists WFMANAGE;",
			// " create database WFMANAGE;",
			"USE studentprofile;",
			// " drop table if exists REQUEST;",
		   // " create table REQUEST;",
			"DROP TABLE IF EXISTS ENROLLMENT;",
			"DROP TABLE IF EXISTS USER_INTERESTS;",
			"DROP TABLE IF EXISTS ANNOUNCEMENT;",
			"DROP TABLE IF EXISTS NEWS;",
					"DROP TABLE IF EXISTS INTEREST;",
					"CREATE TABLE INTEREST("						
					+ "INTEREST_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,"
					+ "INTEREST_NAME VARCHAR(50) NOT NULL," 
					+ "IS_CURRENT CHAR(1) NOT NULL);",
					
					
					"CREATE TABLE  ANNOUNCEMENT("
					+"ANNOUNCEMENT_ID INT(20) unsigned NOT NULL " 
					+"AUTO_INCREMENT PRIMARY KEY,"
					+"ANNOUNCEMENT_NAME VARCHAR(200) UNIQUE NOT NULL,"
					+"IS_CURRENT CHAR(1) NOT NULL,"
					+"INTEREST_ID INT(10) UNSIGNED NOT NULL,"
					+"DURATION DATE NOT NULL,"
					+"FOREIGN KEY (INTEREST_ID) REFERENCES "
					+"INTEREST(INTEREST_ID));",
					
					"CREATE TABLE  NEWS("
					+"NEWS_ID INT(20) unsigned NOT NULL " 
					+"AUTO_INCREMENT PRIMARY KEY,"
					+"NEWS_NAME VARCHAR(200) UNIQUE NOT NULL,"
					+"IS_CURRENT CHAR(1) NOT NULL,"
					+"INTEREST_ID INT(10) UNSIGNED NOT NULL,"
					+"DURATION DATE NOT NULL,"
					+"FOREIGN KEY (INTEREST_ID) REFERENCES "
					+"INTEREST(INTEREST_ID));",
					
					"DROP TABLE IF EXISTS SYLLABUS;",
					"DROP TABLE IF EXISTS COURSE;", 
					"DROP TABLE IF EXISTS SEMESTER;", 
					"DROP TABLE IF EXISTS FRIEND;",
					"DROP TABLE IF EXISTS SUBJECT;",
					"DROP TABLE IF EXISTS USER;",               
					"CREATE TABLE  USER ("
					+"ROLL_NO VARCHAR(25) NOT NULL,"
					+"USER_NAME VARCHAR(15) UNIQUE NOT NULL,"
					+"PASSWORD VARCHAR(100) NOT NULL," 
					+"DOB DATE NOT NULL," 
					+"EMAIL_ID VARCHAR(50) NOT NULL," 
					+"IMAGE VARCHAR(200),"
					+"LAST_LOGIN TIMESTAMP," 
					+"PRIMARY KEY(ROLL_NO));",

					
					"CREATE TABLE SEMESTER ("
					+"SEMESTER_ID INT(10) UNSIGNED NOT NULL " 
					+"AUTO_INCREMENT," 
					+"SEMESTER_NAME VARCHAR(50) NOT NULL,"
					+"IS_CURRENT CHAR(1) NOT NULL," 
					+"PRIMARY KEY(SEMESTER_ID));",
					
					
					"DROP TABLE IF EXISTS FACULTY;",
					"CREATE TABLE FACULTY("
					+"FACULTY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,"
					+"FACULTY_NAME VARCHAR(50),"
					+"IS_CURRENT CHAR(1) NOT NULL,"
					+"ADDRESS VARCHAR(100),"
					+"DESIGNATION VARCHAR(50),"
					+"CONTACT_NO VARCHAR(15),"
					+"EMAIL_ID VARCHAR(50) NOT NULL,"
					+"PRIMARY KEY(FACULTY_ID)"
					+");",

					"DROP TABLE IF EXISTS SUBJECT;", 
					"CREATE TABLE SUBJECT ("
					+"SUBJECT_ID INT(10) UNSIGNED NOT NULL " 
					+"AUTO_INCREMENT,"
					+"SUBJECT_CODE VARCHAR(20) UNIQUE NOT NULL,"
					+"SUBJECT_NAME VARCHAR(50) NOT NULL,"
					+"IS_CURRENT CHAR(1) NOT NULL,"
					+"FACULTY_ID INT(10) UNSIGNED NOT NULL, "
					+"PRIMARY KEY(SUBJECT_ID),"
					+"FOREIGN KEY (FACULTY_ID) REFERENCES FACULTY "
					+"(FACULTY_ID));",
					
					"CREATE TABLE COURSE("
					+"SEMESTER_ID INT(10) UNSIGNED NOT NULL,"
					+"SUBJECT_ID INT(10) UNSIGNED NOT NULL,"
					+"PRIMARY KEY (SUBJECT_ID),"
					+"FOREIGN KEY (SEMESTER_ID) REFERENCES "
					+"SEMESTER(SEMESTER_ID),"
					+"FOREIGN KEY (SUBJECT_ID) REFERENCES SUBJECT "
					+"(SUBJECT_ID));",

					
					"CREATE TABLE USER_INTERESTS(ROLL_NO " 
					+"VARCHAR(25) NOT NULL," 
					+"INTEREST_ID INT(10) UNSIGNED NOT NULL,"
					+"PRIMARY KEY(ROLL_NO,INTEREST_ID),"
					+"FOREIGN KEY(ROLL_NO) REFERENCES USER "
					+"(ROLL_NO),FOREIGN KEY(INTEREST_ID) REFERENCES " 
					+"INTEREST(INTEREST_ID));",

					 
					"CREATE TABLE FRIEND (ROLL_NO VARCHAR(25) " 
					+"NOT NULL, FRIEND_ROLL_NO VARCHAR(25) NOT " 
					+"NULL, PRIMARY KEY (ROLL_NO,FRIEND_ROLL_NO), "
					+" FOREIGN KEY (ROLL_NO) REFERENCES " 
					+"USER(ROLL_NO),FOREIGN KEY (FRIEND_ROLL_NO) " 
					+"REFERENCES USER(ROLL_NO) );",

					 
					"CREATE TABLE SYLLABUS (SUBJECT_ID INT(10)" 
					+"UNSIGNED NOT NULL," 
					+ "CHAPTER_NAME VARCHAR"
					+"(50) NOT NULL, FOREIGN KEY(SUBJECT_ID)" 
					+"REFERENCES SUBJECT(SUBJECT_ID));",

					
					"CREATE TABLE ENROLLMENT ("
					+"ROLL_NO VARCHAR(10) NOT NULL,"
					+"SUBJECT_ID INT(10) UNSIGNED NOT NULL,"
					+"GRADE VARCHAR(10),"
					+"GRADE_POINT FLOAT(15),"
					+"RESULT VARCHAR(10),"
					+"SEMESTER_ID INT(10) UNSIGNED NOT NULL,"
					+"IS_ENROLLED VARCHAR(10) NOT NULL," 
					+"FOREIGN KEY (ROLL_NO) REFERENCES USER"
					+"(ROLL_NO),FOREIGN KEY (SUBJECT_ID) REFERENCES SUBJECT"
					+"(SUBJECT_ID),	FOREIGN KEY (SEMESTER_ID) REFERENCES " 
					+"SEMESTER(SEMESTER_ID));"
	    };

}
